I need some help with getting Agent-Canvas to work...
# general
m
I need some help with getting Agent-Canvas to work. I installed it in a Docker container running on Unraid, and I made a connection with the backend. However, i can't make a connection with the Ollama container running also on Unraid, where my models are stored. I do a test i get an error like this: litellm.APIConnectionError: OllamaException - Cannot connect to host host. docker.internal:11434 ssl:<ssl.SSLContext object at 0x14b6591dd130> [Connect call failed ('192.168.X.X', 11434)] I don't understand this cause i don't know why it looking for an SSL connection while I just want it to connect internally to my Ollama container. I also don't know why I failed to connect to a different IP address, which I did not configure. The IP address it is mentioned as failed is the IP address of my reverse proxy. I don't know why it connects to that ip address with the port number of the Ollama container.
l
Thanks @modern-garden-55994, interesting setup! Could you share the exact docker commands you ran for both openhands and ollama?
m
You mean the Docker Compose file of Ollama? and that of openhand Agent-Canvas?
l
Yes, I’d like to know the two command that you ran so I can try to reproduce the error.
(you could also open an issue on the OpenHands/OpenHands repo if you’d like)
m
Let me see if i can post the docker compose here of both the containers
This for Ollama running as a container on Unraid
This for Agent-Canvas
Both are running on the same server namely Unraid. I run Agent Canvas through Portainer in Unraid because Unraid did not have a template for it yet
l
OK, thanks. Did you run any command line commands? Could you share those?
m
No, I did not run any command-line command. i prefer to do everything through Docker Compose
l
OK, got it. This might be easier for us to reproduce if we can get step-by-step instructions for how to run the program the same way you did.
m
the two Docker compose file are the only two things needed. You can run Ollama also in Portainer. You don't need Unraid. Most of the settings are environment variables
i think that in agent-canvas there is a setting that is forcing the app to go through a litlellm provider and that is causing the problem
do you find a solution?
l
I’m sorry, your explanation so far hasn’t been clear enough for us to reproduce the problem. We’d need step-by-step directions
m
But you haven't told me what you need exactly. You just ignored me till i asked you. You could have responded and asked me for additional information. I have sent you all the information you asked me for so far. If you want more, you can just ask
l
I said:
OK, got it. This might be easier for us to reproduce if we can get step-by-step instructions for how to run the program the same way you did.
But you did not give me step-by-step instructions. They need to be more concrete than a couple screenshots. If you’re not sure what I’m talking about, take a look at the instructions we have in the openhands docs. You’ll see how they say things like “first, do this, then do this” etc.
m
I will provide you a Docker Compose file without the use of Unraid. You need to have a Docker environment to run it as a container. Are you familiar with the docker-compose up command to start a container? If you prefer to run is without Docker Compose, I can convert it for you
l
Yep, if I have a full docker compose file, and then instructions about how you clicked through the interface after ollama and the agent canvas came up then I can probably use that to reproduce.
m
i told you that at the beginning of the conversation. I just ran the Docker Compose file of agent-canvast, and then I connected to the web UI, which in my case is the IP of my Unraid / 8042. I could not use 8000 because it is already used by Portainer. In the webui i configure the backend, and i said it is running; that was it.
Whatever I do in the user interface, just to test the app by typing test and enter i get this message: litellm.APIConnectionError: OllamaException - Cannot connect to host host. docker.internal:11434 ssl:ssl.SSLContext object at 0x14663d5b1130 This is hardcoded somewhere cause as i said, it keeps looking for a secure SSL connection and not for the internal Ollama server, which is a container on the Unraid server
l
OK, if you can share the docker compose file we could probably try it
m
services:
ollama:
container_name: ollama
networks:
- ai-net # change it to match your environment
restart: always
image: "ollama/ollama"
ports:
- "11434:11434"
volumes:
- /volume1/docker/ollama:/root/.ollama # change it to match your environment
environment:
- OLLAMA_HOST=0.0.0.0:11434
- OLLAMA_ORIGINS=*
- OLLAMA_KEEP_ALIVE=-1
- OLLAMA_MODELS=/root/.ollama/models
networks:
ai-net:
external: true
l
And the one for agent canvas?
Ah, I see, that’s the screenshot you shared above.
Thanks, this should be enough for now, it may take a little bit to check.
m
# ignored : docker/podman mkdir -p ~/projects ~/.openhands
name: <openhands_agent-canvas>
services:
agent-canvas:
stdin_open: true
tty: true
container_name: agent-canvas
networks:
- ai-net # change it to match your environment
ports:
- 8082:8000 # port 8000 was already taken
volumes:
- /mnt/user/appdata/openhands:/home/openhands/.openhands:rw # change it to match your environment
- /mnt/user/appdata/projects:/projects:rw  # change it to match your environment
image: <http://ghcr.io/openhands/agent-canvas:latest|ghcr.io/openhands/agent-canvas:latest>
restart: unless-stopped
networks:
ai-net:
external: true
i also want to know which settings i should use for this:
👍 1
m
Thanks for sharing the Compose files. I believe the issue is the Ollama URL configured in Agent Canvas. Since both containers are attached to the external Docker network
ai-net
, Agent Canvas should reach Ollama using the container name—not
host.docker.internal
or the reverse-proxy address. In the Agent Canvas LLM settings, please use: - Provider: Ollama - Ollama Base URL:
<http://ollama:11434>
- Model: the exact model name installed in Ollama, such as
llama3.2
- API key: leave empty unless the UI requires one Please make sure the shared network exists and both containers are connected to it:
Copy code
bash
docker network create ai-net
docker network inspect ai-net
The
docker network inspect
output should list both
ollama
and
agent-canvas
. You can also test connectivity directly from the Agent Canvas container:
Copy code
bash
docker exec -it agent-canvas sh
curl <http://ollama:11434/api/tags>
That should return Ollama’s model list. If it does not, the two containers are not actually sharing the same Docker network. The
ssl:<ssl.SSLContext ...>
text in the error does not necessarily mean HTTPS was configured. The main problem is that
host.docker.internal
resolves to the Docker host/reverse proxy rather than the Ollama container. Use
<http://ollama:11434>
for direct container-to-container communication. This response was prepared by an AI agent (OpenHands) on behalf of the user.
m
I did the docker exec command and it showed me all the models that are currtely installed on Ollama
I can't use the Provider field in the basic settings. If I choose it, I can't find Ollama in the dropdown list, and if I type it, it disappears when I leave that field
i can only use the advanced and all settings, and there you don't have the provider option
m
That’s useful—if
docker exec ... curl <http://ollama:11434/api/tags>
showed your models, then the Docker networking is working. The remaining problem is the Agent Canvas LLM configuration, not connectivity. You do not need to select
Ollama
in the Provider field if that field is unavailable. In the Advanced or All settings view, try configuring: - Model:
ollama/<exact-model-name>
(replace this with the name shown by `/api/tags`; for example,
ollama/llama3.2
) - Ollama Base URL:
<http://ollama:11434>
- Base URL, if that is the only URL field available:
<http://ollama:11434>
- API key: leave empty, or use a placeholder only if the form requires a value The important part is that the model name uses the Ollama provider prefix and the URL is the internal Docker hostname. Do not enter
host.docker.internal
, your reverse-proxy hostname, or
https://
. After saving the settings, start a new conversation so it uses the updated LLM configuration. If the settings page does not expose either
Ollama Base URL
or
Base URL
, please share a screenshot of the All settings fields (with any credentials/API keys hidden), along with the exact Agent Canvas image tag/version. Then we can identify which field maps to LiteLLM’s
api_base
for that version. This follow-up was prepared by an AI agent (OpenHands) on behalf of the user.
m
It seems that it finally works. if i use llama3.2 it give me an error that the model is not suitable for thinking. Then i change it and choose qwen3-v1:8b. the model asked me what i want to build and i answer with a prompt " a webiste". The model then throw an error like this: Your last response did not include a function call or a message. Please use a tool to proceed with the task.
Also if i run the curl http://ollama command i only see the qwen model but not the other models like deepseek-r1:14b-qwen-distill-q4_K_M
m
Good progress: the Docker connection is working. The remaining issue is likely the Ollama model configuration. First, list the exact installed model names from inside the Agent Canvas container:
Copy code
bash
curl -s <http://ollama:11434/api/tags>
Use the exact
name
returned there.
curl <http://ollama>
is not the model-list endpoint. Your Ollama Compose file also needs a larger context window. OpenHands’ current local-LLM documentation says the Ollama default of 4096 tokens is too small; use at least 22000, or 32768 if your hardware allows it:
Copy code
yaml
environment:
  - OLLAMA_HOST=0.0.0.0:11434
  - OLLAMA_CONTEXT_LENGTH=22000
  - OLLAMA_KEEP_ALIVE=-1
  - OLLAMA_ORIGINS=*
After changing this, recreate/restart the Ollama container; changing the Compose file alone does not update an existing container. For Agent Canvas, use:
Copy code
text
Model: ollama/<exact-name-from-api-tags>
Base URL: <http://ollama:11434>
API key: local-llm
Replace the model placeholder with the exact installed model name. Do not use
host.docker.internal
, the reverse-proxy hostname, or
https://
. The
qwen3-v1:8b
error—“Your last response did not include a function call or a message”—means the model connected but did not produce a valid OpenHands tool call or assistant message. Small/general models can work for chat but fail at agent tool calling. Try a coding-oriented instruct model instead. The current OpenHands docs recommend `Qwen3.6-35B-A3B`;
qwen2.5-coder-14b-instruct
is another community-reported option. Use the exact Ollama tag available in your
/api/tags
output. The
llama3.2
“not suitable for thinking” error is also a model-capability mismatch, not a Docker-network problem. After updating the context length and selecting a suitable coding model, save the settings and start a new conversation. Current documentation: https://docs.openhands.dev/openhands/usage/llms/local-llms This response was prepared by an AI agent (OpenHands) on behalf of the user.
Please use the consolidated troubleshooting response in the preceding bot message; this duplicate has been superseded. This response was prepared by an AI agent (OpenHands) on behalf of the user.
m
I used the exact name that you advised
Copy code
curl -s <http://ollama:11434/api/tags>    but it only listed Qwen model and not the other models.
i did not post all the settings from Unraid but i had the settings already configured what you were talking about
m
Thanks for the screenshot—that clarifies that the Ollama environment variables are already configured. Since
curl <http://ollama:11434/api/tags>
returns only Qwen, Agent Canvas is reaching an Ollama instance whose current model store contains only Qwen. This is not an SSL or LiteLLM routing problem. Please verify the following in Portainer: 1. Open the Ollama container console and run:
Copy code
bash
   ollama list
2. In the Agent Canvas container console, run:
Copy code
bash
   getent hosts ollama
   curl -s <http://ollama:11434/api/tags>
3. Compare the two outputs. They should show the same model list. 4. In Ollama’s container settings, check the volume mounted at
/root/.ollama
. Make sure it is the directory where
deepseek-r1:14b-qwen-distill-q4_K_M
and the other models were actually downloaded. If the models were downloaded in a different Ollama container or volume, the current container will not see them. 5. Check that there is only one container named/aliased
ollama
on the shared
ai-net
network. A stale second Ollama container can make the hostname resolve to the wrong instance. If
ollama list
itself shows only Qwen, pull the missing model into this exact container, for example:
Copy code
bash
ollama pull deepseek-r1:14b-qwen-distill-q4_K_M
Then repeat
curl -s <http://ollama:11434/api/tags>
. For Agent Canvas, keep the model field as
ollama/<exact name returned by /api/tags>
and the base URL as
<http://ollama:11434>
. Do not add
https://
or use the reverse-proxy address. The Qwen error (“last response did not include a function call or a message”) is a separate model-compatibility issue: the model connected, but it did not emit a valid OpenHands tool call. Once the model list is corrected, test with an instruct/coding model that supports tool use and start a new conversation. The context-length setting can affect long tasks, but it would not explain why
/api/tags
lists only Qwen. This response was prepared by an AI agent (OpenHands) on behalf of the user.
One additional point: the model you selected may not be recommended for OpenHands agentic work. The current OpenHands documentation recommends Qwen3.6-35B-A3B as the first local model to try. For Ollama, the documented example is:
Copy code
bash
OLLAMA_CONTEXT_LENGTH=32768 OLLAMA_HOST=0.0.0.0:11434 OLLAMA_KEEP_ALIVE=-1 ollama serve
ollama pull qwen3.6:35b-a3b
If 32k context is too demanding for your hardware, use at least
22000
. In Agent Canvas, use the exact model name returned by
/api/tags
, prefixed with
ollama/
, and keep the base URL as
<http://ollama:11434>
. Your
qwen3-v1:8b
model is not the model named in the OpenHands recommendation, and the error saying that the response did not contain a function call or message is consistent with a model that can chat but does not reliably follow OpenHands’ tool-calling format.
llama3.2
is also not a good choice here because OpenHands reported that it was unsuitable for the configured thinking mode. The documentation also lists these community-reported alternatives when a local model behaves like a chatbot or repeatedly fails tool calls: -
qwen2.5-coder-14b-instruct
-
qwopus3.5-27b-v3 Q8_0
(or similar retrained qwopus variants) These are community reports, not guarantees. Use the exact Ollama tag that exists in your
/api/tags
output. DeepSeek-R1 can be useful for reasoning, but it is not the primary model recommended in the current OpenHands local-LLM guide for reliable coding/tool use. Recommended next test: 1. Install
qwen3.6:35b-a3b
in the Ollama container, if your GPU/RAM can run it. 2. Set
OLLAMA_CONTEXT_LENGTH=32768
(or
22000
if necessary) and recreate the Ollama container. 3. Confirm it appears at
curl -s <http://ollama:11434/api/tags>
. 4. Configure Agent Canvas with
ollama/qwen3.6:35b-a3b
, base URL
<http://ollama:11434>
, and a new conversation. Documentation: https://docs.openhands.dev/openhands/usage/llms/local-llms This follow-up was prepared by an AI agent (OpenHands) on behalf of the user.
l
(other smaller versions of qwen-3.6 should also be good)
m
image.png
get
t seems that it worked in the agent canvas container without the docker exec -it
I am downloading qwen3.6:35b-a3b but the reason i had qwen3-vl:8b was that i was advised to use a vision language model because i want to be able to build apps
i downloaded qwen3.6:35b-a3b but it gaves me the same results
l
What’s shown in the “thinking”?
m
image.png
l
Ok, I'm done for the day but can take another look later
m
no problem. Goodnight. We talk tomorrow
Good evening. I did not ask for your help this weekend cause i think we can continue in this coming week. Enjoy your weekend, and I will look forward to hearing from you tomorrow